package startPoint;

import drumkit.Drumkit;

import javax.xml.parsers.ParserConfigurationException;
import java.io.IOException;

import org.xml.sax.SAXException;
import song.*;

/**
 * Created by IntelliJ IDEA.
 * User: Aleksey
 * Date: 02.01.2008
 * Time: 18:24:36
 */
public class TestStartPoint {
    private void test() throws IOException, SAXException, ParserConfigurationException {
        /*Drumkit drumkit;
        drumkit = new Drumkit("./instruments/dfh.xml");

        TimeSignature t1 = new TimeSignature(true, 2, 3);
        TimeSignature t2 = new TimeSignature(true, 1, 3);
        TimeSignature t = TimeSignature.sum(t1, t2);
        t.getBeatNumber();

        Song song = new Song(drumkit);

        DrumTrack drumTrack = null;

        DrumSubTrack subTrack = new DrumSubTrack(drumkit.getDrum(0), 0);
        Bar bar = new Bar(120, new TimeSignature(false, 4, 2));

        bar.getPart(0).setNote(true);
        bar.getPart(0).setVelocity(100);
        bar.getPart(0).setStyle(1);
        bar.getPart(3).setNote(true);
        bar.getPart(3).setVelocity(100);

        subTrack.addBar(bar);
        drumTrack.addSubTrack(subTrack);

        DrumSubTrack subTrack2 = new DrumSubTrack(drumkit.getDrum(9), 0);
        Bar bar2 = new Bar(120, new TimeSignature(false, 4, 2));

        bar2.getPart(0).setNote(true);
        bar2.getPart(0).setVelocity(127);
        bar2.getPart(1).setNote(true);
        bar2.getPart(1).setVelocity(100);
        bar2.getPart(2).setNote(true);
        bar2.getPart(2).setVelocity(100);
        bar2.getPart(3).setNote(true);
        bar2.getPart(3).setVelocity(127);

        subTrack2.addBar(bar2);
        drumTrack.addSubTrack(subTrack2);

        DrumSubTrack subTrack3 = new DrumSubTrack(drumkit.getDrum(8), 1);
        Bar bar3 = new Bar(120, new TimeSignature(false, 4, 2));

        bar3.dividePart(0);
        bar3.dividePart(2);
        bar3.dividePart(4);
        bar3.dividePart(6);
        for (int i = 0; i < 8; i++) {
            bar3.getPart(i).setNote(true);
            bar3.getPart(i).setVelocity(65);
        }

        subTrack3.addBar(bar3);
        drumTrack.addSubTrack(subTrack3);

        //song.setDrumTrack(drumTrack);

        subTrack2.addBar(bar3);
        subTrack3.addBar(bar3);
        subTrack.addBar(new Bar(120, new TimeSignature(false, 4, 2)));
        song.saveToFile("./", "1");*/
    }

    /*public static void main(String[] args) {
        try {
            new TestStartPoint().test();
        }
        catch (IOException e) {
            e.printStackTrace();
        }
        catch (SAXException e) {
            e.printStackTrace();
        }
        catch (ParserConfigurationException e) {
            e.printStackTrace();
        }
    }*/
}
